<?php
include_once("../global.php");
header("Content-type: text/html;charset=GB2312");
       
$sql = "select tell,fax,phone from dcusperson where 1=1";

if(!empty($_REQUEST[dept])) $sql.=" and dept='".$_REQUEST[dept]."'";
//if(!empty($_REQUEST[customer_id])) $sql.=" and customer_id='".$_REQUEST[customer_id]."'";

if(!empty($_REQUEST[customer_id])) $query="select customer_id  from dcustomermsg where customer like'%".$_REQUEST[customer_id]."%'";

if(!empty($_REQUEST[customer_id])) $sql.=" and customer_id in ($query)";

if(!empty($_REQUEST[name])) $sql.=" and name='".$_REQUEST[name]."'";

 $ppt_temp=$db->get_sql_row($sql);

      $pptstr=$ppt_temp[0].','.$ppt_temp[1].','.$ppt_temp[2];
      echo $pptstr;

?>